package com.example.demo.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.Finance;
import com.example.demo.mapper.FinanceMapper;
import com.example.demo.service.FinanceService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FinanceServiceimpl extends ServiceImpl<FinanceMapper, Finance> implements FinanceService {

    @Override
    public List<Finance> getAllFinance() {
        return baseMapper.selectList(null);
    }

    @Override
    public Finance getFinanceBypayrollmonth(String payrollmonth) {
        QueryWrapper<Finance> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("payrollmonth", payrollmonth);
        return baseMapper.selectOne(queryWrapper);
    }
}
